package com.example.demo.global;

import com.example.demo.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public Object handleException(Exception e) {
        log.error("系统异常", e);
        return Result.fail("系统异常");
    }
}
